// NCPrdouctRemindController NCProductRemindUtil NCProductRemindSchedule

@isTest
private class NCProductRemindControllerTest {
    
    static testMethod void testMethod1() {
    	 //产品
        Product__c p = TestUtils.createInst();
		p.NCCode__c = 'xx001';        
        insert p;

    	ProductRemind__c pr = new ProductRemind__c();
    	pr.Product__c = p.Id ; 
    	pr.BatchCode__c  = '001234';
    	pr.EndDate__c = System.today().addDays(1);
    	insert pr; 

    	ProductRemindDetails__c prd = new ProductRemindDetails__c();
    	prd.ProductRemind__c = pr.Id; 
    	prd.AccountNumber__c = 'MKSY';
    	insert prd;


    	 NCProductRemindSchedule sc = new NCProductRemindSchedule();
        String fmt = '0 10 0 1-31 1-12 ? 2017-2098';//每天执行一次
        System.schedule('客户首次出库提醒 计划任务；'+Datetime.now().format('yyyyMMddHHmmss'), fmt, sc); 
        NCProductRemindUtil.remindToUser();
        
    	NCPrdouctRemindController npc = new NCPrdouctRemindController();
    	npc.setNil();
    	npc.getDetails();
    	npc.searchJson = EncodingUtil.urlEncode('{"batchcode":"001234"}', 'UTF-8');
    	npc.searchNCProduct();


    	npc.saveJson = npc.dataJson;
    	npc.save();
    	npc.invalidPrId = pr.Id; 
    	npc.getRemindDetails();
    	npc.setPrInvalid();


    	//




    }
}